<extend name="Base/common"/>
<block name="css">
    <link rel="stylesheet" href="__CSS__/detail.css"/>
</block>
<block name="body">
    <div class="page-group" >
        <div class="page page-current" style="background-color: #fff">
           <!--<div class="dHead">
               <div class="buttons-tab dTabs">
                   <a href="#tab1" class="tab-link active button">商品详情</a>
                   <a href="#tab2" class="tab-link button">评论</a>
               </div>
           </div>-->
            <header class="bar bar-nav comHead">
                <a class="iconfont icon-xiangzuojiantou pull-left button button-link back"
                   href="javascript:history.go(-1);"></a>
                <a href="javascript:" class="title">商品详情</a>
            </header>
            <div class="content">
                <div class="content-block noEdge dContent">
                    <div class="tabs">
                        <div id="tab1" class="tab active">
                            <div class="content-block noEdge">
                                <div style="padding: 0" class="swiper-container" data-space-between='10' data-pagination='.swiper-pagination' data-autoplay="2000">
                                    <div class="swiper-wrapper">
                                        <volist name="good.pictures" id="pic">
                                            <div class="swiper-slide"><img style="margin: 0 auto" src="{$pic|getThumbImageById=1080,720}" alt=""></div>
                                        </volist>
                                    </div>
                                </div>

                                <div class="dInfo">
                                    <p class="dName">{$good.name}</p>
                                    <if condition="$good.price eq 0">
                                        <span class="button button-fill">免费</span>
                                    <else/>
                                        <if condition="$is_pay">
                                            <span class="button button-fill">已购</span>
                                        <else/>
                                            <span class="button button-fill">试读</span>
                                        </if>
                                    </if>
                                </div>

                                <div class="dIntro">
                                    <div class="dTitle"><i class="iconfont icon-jieshao"></i>介绍</div>
                                    <div class="dMore">{$good.introduce}</div>
                                </div>

                                <div class="dIntro dPre">
                                    <div class="dTitle">
                                        <if condition="$good.price eq 0">
                                            <i class="iconfont icon-jieshao"></i>免费
                                        <else/>
                                            <if condition="$is_pay">
                                               <i class="iconfont icon-jieshao"></i>已购
                                            <else />
                                               <i class="iconfont icon-jieshao"></i>试读
                                            </if>
                                        </if>
                                    </div>
                                    <if condition="$good.price eq 0">
                                        <div class="dMore">{$good.content}</div>
                                    <else/>
                                        <if condition="$is_pay">
                                            <div class="dMore">{$good.content}</div>
                                        <else/>
                                            <div class="dMore">{$good.show}</div>
                                        </if>
                                    </if>
                                    <div class="tip">
                                        <if condition="$good.price eq 0">
                                            <p>阅读</p>
                                        <else/>
                                            <if condition="$is_pay">
                                                <p>阅读</p>
                                                <else />
                                                <p>购买即可阅读全文</p>
                                            </if>
                                        </if>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="tab2" class="tab">
                            <div class="content-block noEdge">
                                <div class="cmtHead">
                                    <i class="iconfont icon-xiaoxi"></i>全部评论 20000
                                </div>
                                <include file="_judge"/>
                                <a class="sBtn iconfont icon-fabu open-about" href="javascript:" data-role="go-comment"></a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


            <!--底部悬浮栏-->
            <div class="dBottom">
                <div class="dLeft do-collect" data-id="{$good.id}">
                    <i class="iconfont icon-concerned"
                    <neq name="is_login" value="0"><eq name="good.is_collect" value="1">style="color:red";</eq></neq>>
                    </i>
                    <span>收藏</span>
                </div>
                <if condition="$good.price eq 0">
                    <a href="{:U('article',array('id'=>$good['id']))}" class="dPrice goBuy">阅读</a>
                <else/>
                    <if condition="$is_pay">
                        <a href="{:U('article',array('id'=>$good['id']))}" class="dPrice goBuy">阅读</a>
                    <else/>
                        <form name="form" method="post">
                            <input hidden type="text" id="goods_id" name="goods_id" value="{$good.id}">
                            <a href="javascript:" data-role="goBuy" class="dPrice goBuy">￥ {$good.price} 购买</a>
                        </form>
                     </if>
                </if>
            </div>
        </div>
    </div>
</block>
<block name="other">
    <div class="popup popup-about sendWrap">
        <div class="content-block">
            <textarea placeholder="写评论......" class="sendArea" rows="3"></textarea>
            <div class="commentOp">
                <!--<i class="iconfont icon-biaoqing"></i>-->
                <a href="javascript:" data-role="sendComment" data-id="{$weibo.id}" class="proBtn close-popup">发布</a>
            </div>
        </div>
    </div>
</block>
<block name="script">
    <script>
        $("[data-role='go-comment']").click(function () {
            $.popup('.sendWrap')
        });
//        $(".swiper-container").swiper({speed: 400})
        $("[data-role='goBuy']").click(function () {
            //document.form.submit();
            var goods_id = $('#goods_id').val();
            $.post("{:U('Order/index/addOrder')}",{goods_id:goods_id},function (res) {
                $("[data-role='goBuy']").unbind();
                if(res.status==1){
                    $.toast(res.info);
                    location.href=res.url;
                }else {
                    $.toast(res.info);
                }
            })
        })
    </script>
    <script src="__JS__/detail.js"></script>
</block>